home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / elib-006.lha / elib-0.06 / elib-compile-all.el < prev    next >
Lisp/Scheme  |  1993-01-24  |  2KB  |  62 lines

  1. ;;;; $Id: elib-compile-all.el,v 0.7 1993/01/24 19:29:06 ceder Exp $
  2. ;;;; This file byte-compiles all .el files in elib.
  3. ;;;;
  4. ;;;; Copyright (C) 1991, 1992 Free Software Foundation
  5. ;;;;
  6. ;;;; This file is part of the GNU Emacs lisp library, Elib.
  7. ;;;;
  8. ;;;; GNU Elib is free software; you can redistribute it and/or modify
  9. ;;;; it under the terms of the GNU General Public License as published by
  10. ;;;; the Free Software Foundation; either version 1, or (at your option)
  11. ;;;; any later version.
  12. ;;;;
  13. ;;;; GNU Elib is distributed in the hope that it will be useful,
  14. ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. ;;;; GNU General Public License for more details.
  17. ;;;;
  18. ;;;; You should have received a copy of the GNU General Public License
  19. ;;;; along with GNU Emacs; see the file COPYING.  If not, write to
  20. ;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21. ;;;;
  22.  
  23.  
  24. (setq elib-files '("stack-f"
  25.            "stack-m"
  26.            "queue-f"
  27.            "queue-m"
  28.            "elib-node"
  29.            "dll"
  30.            "dll-debug"
  31.            "bintree"
  32.            "avltree"
  33.            "cookie"
  34.            "string"
  35.            "read"))
  36.  
  37.  
  38. (defun compile-file-if-necessary (file)
  39.   "Compile the Elib file FILE if necessary.
  40.  
  41. This is done if FILE.el is newer than FILE.elc or if FILE.elc doesn't exist."
  42.   (let ((el-name (concat file ".el"))
  43.     (elc-name (concat file ".elc")))
  44.     (if (or (not (file-exists-p elc-name))
  45.         (file-newer-than-file-p el-name elc-name))
  46.     (progn
  47.       (message (format "Byte-compiling %s..." el-name))
  48.       (byte-compile-file el-name)))))
  49.  
  50.  
  51. (defun compile-elib ()
  52.   "Byte-compile all uncompiled files of elib."
  53.  
  54.   ;; Be sure to have . in load-path since a number of files in elib
  55.   ;; depend on other files and we always want the newer one even if
  56.   ;; a previous version of elib exists.
  57.  
  58.   (interactive)
  59.   (let ((load-path (append '(".") load-path)))
  60.     (mapcar (function compile-file-if-necessary)
  61.         elib-files)))
  62.